package com.gzu.se.service.impl;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gzu.se.entity.Users;
import com.gzu.se.mapper.UserMapper;
import com.gzu.se.mapper.CartMapper;
import com.gzu.se.mapper.OrderMapper;


import com.gzu.se.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private OrderMapper orderMapper;
    @Autowired
    private CartMapper cartMapper;

    @Override
    public void register(Users user) {
        userMapper.insert(user);
    }

    @Override
    public Users login(String username, String password) {
        return userMapper.selectOne(new QueryWrapper<Users>().eq("username", username).eq("password", password));
    }

    @Override
    public void deleteUser(Long id) {

    }

    @Override
    public void update(Users user) {
        userMapper.updateById(user);
    }
}
